package com.rc.saas.tenant.vo.hlht;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rc.saas.tenant.vo.discount.DiscountTimeSaveVo;

import java.util.Date;
import java.util.List;

/**
 * @author frog
 * @date 2021/6/11
 */
public class HlhtDiscountResultVo {
    private String tenantCode;
    private Long discountStationId;
    private String tenantName;
    private String hlhtOperatorName;
    private String nickname;
    private String mobile;
    private String stationName;
    private String remark;
    //0服务费打折 1 特定服务费（活动价）
    private String discountType;
    //全天/分时段
    private String timeType;
    //备注
    private String policyDesc;
    //互联互通内部运营商名称
    private String hlhtTenantName;
    //优惠活动开始时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date beginTime;
    //优惠活动结束时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;
    //活动进行状态
    private String status;
    private List<DiscountTimeSaveVo> discountTimeSaveVoList;

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public Long getDiscountStationId() {
        return discountStationId;
    }

    public void setDiscountStationId(Long discountStationId) {
        this.discountStationId = discountStationId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public String getHlhtOperatorName() {
        return hlhtOperatorName;
    }

    public void setHlhtOperatorName(String hlhtOperatorName) {
        this.hlhtOperatorName = hlhtOperatorName;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getDiscountType() {
        return discountType;
    }

    public void setDiscountType(String discountType) {
        this.discountType = discountType;
    }

    public String getTimeType() {
        return timeType;
    }

    public void setTimeType(String timeType) {
        this.timeType = timeType;
    }

    public String getPolicyDesc() {
        return policyDesc;
    }

    public void setPolicyDesc(String policyDesc) {
        this.policyDesc = policyDesc;
    }

    public String getHlhtTenantName() {
        return hlhtTenantName;
    }

    public void setHlhtTenantName(String hlhtTenantName) {
        this.hlhtTenantName = hlhtTenantName;
    }

    public List<DiscountTimeSaveVo> getDiscountTimeSaveVoList() {
        return discountTimeSaveVoList;
    }

    public void setDiscountTimeSaveVoList(List<DiscountTimeSaveVo> discountTimeSaveVoList) {
        this.discountTimeSaveVoList = discountTimeSaveVoList;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getStatus() {
        Date date = new Date();
        long time = date.getTime();
        if (beginTime != null && endTime.toString() != null) {
            if (beginTime.getTime() > time) {
                return "未开始";
            } else if (beginTime.getTime() < time && endTime.getTime() > time) {
                return "进行中";
            } else if (endTime.getTime() < time) {
                return "已结束";
            }
        }
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
